﻿using System;
using System.Collections.Generic;
using SharpSqlAnalyzer.nodes;
using SharpSqlAnalyzer.nodes.teradata;

namespace SharpSqlAnalyzer.stmt.teradata
{
	// Token: 0x020000CC RID: 204
	public class TTeradataCollectStatistics : TCustomSqlStatement
	{
		// Token: 0x0600074F RID: 1871 RVA: 0x00300636 File Offset: 0x002FE836
		public TTeradataCollectStatistics(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstteradatacollectstatistics;
		}

		// Token: 0x17000156 RID: 342
		// (get) Token: 0x06000750 RID: 1872 RVA: 0x0030064A File Offset: 0x002FE84A
		// (set) Token: 0x06000751 RID: 1873 RVA: 0x00300652 File Offset: 0x002FE852
		public virtual TObjectName TableName
		{
			get
			{
				return this.tableName;
			}
			set
			{
				this.tableName = value;
			}
		}

		// Token: 0x17000157 RID: 343
		// (get) Token: 0x06000752 RID: 1874 RVA: 0x0030065B File Offset: 0x002FE85B
		// (set) Token: 0x06000753 RID: 1875 RVA: 0x00300663 File Offset: 0x002FE863
		public virtual List<TCollectColumnIndex> ColumnIndexList
		{
			get
			{
				return this.columnIndexList;
			}
			set
			{
				this.columnIndexList = value;
			}
		}

		// Token: 0x06000754 RID: 1876 RVA: 0x0030066C File Offset: 0x002FE86C
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			TCollectStatisticsSqlNode tcollectStatisticsSqlNode = (TCollectStatisticsSqlNode)this.rootNode;
			this.tableName = tcollectStatisticsSqlNode.TableName;
			this.table = new TTable();
			this.table.TableName = this.tableName;
			this.table.TableType = ETableSource.objectname;
			this.tables.addTable(this.table);
			this.columnIndexList = tcollectStatisticsSqlNode.ColumnIndexList;
			if (this.columnIndexList != null)
			{
				foreach (TCollectColumnIndex tcollectColumnIndex in this.columnIndexList)
				{
					tcollectColumnIndex.doParse(this, ESqlClause.index);
				}
			}
			return 0;
		}

		// Token: 0x06000755 RID: 1877 RVA: 0x00300738 File Offset: 0x002FE938
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000756 RID: 1878 RVA: 0x00300748 File Offset: 0x002FE948
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.columnIndexList != null)
			{
				foreach (TCollectColumnIndex tcollectColumnIndex in this.columnIndexList)
				{
					tcollectColumnIndex.acceptChildren(v);
				}
			}
			v.postVisit(this);
		}

		// Token: 0x17000158 RID: 344
		// (set) Token: 0x06000757 RID: 1879 RVA: 0x003007B0 File Offset: 0x002FE9B0
		public virtual TTable Table
		{
			set
			{
				this.table = value;
			}
		}

		// Token: 0x040011DC RID: 4572
		private TTable table;

		// Token: 0x040011DD RID: 4573
		private TObjectName tableName;

		// Token: 0x040011DE RID: 4574
		private List<TCollectColumnIndex> columnIndexList;
	}
}
